package groupon.com.bo.controller;

import groupon.common.service.SystemService;
import groupon.common.util.AppConfiguration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class BasicController {
	
	@SuppressWarnings("unused")
	@Autowired
	private SystemService _systemService;
	
	@RequestMapping(value = "/install", method = RequestMethod.GET)
	public String install(){
		try {
			//check if install data is true,install new data to DB
			if(AppConfiguration.isInitDataInstall()){
				_systemService.initializeData(null);
				return "/install" ;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "redirect:bo/manager" ;
	}
}
